const formRows = [{
    span: 24,
    label: '标题',
    component: 'AInput',
    placeholder: '请输入标题',
    prop: 'title',
    allowClear: true
  },
  {
    span: 10,
    label: '文章类型',
    component: 'ASelect',
    prop: 'type',
    placeholder: '请选择文章类型',
    list: [{
        label: '国家政策',
        value: 0
      },
      {
        label: '广东省政策',
        value: 1
      },
      {
        label: '佛山市政策',
        value: 2
      },
      {
        label: '港澳台政策',
        value: 3
      },
    ],
  },
  {
    span: 10,
    label: '发布日期',
    component: 'ADate',
    placeholder: '请选择发布日期',
    prop: 'pulishDate'
  },
  {
    span: 24,
    label: '首图',
    component: 'AUpload',
    prop: 'pic' // 首图
  },
  {
    span: 24,
    label: '内容',
    component: 'RichTextEdit',
    prop: 'content'
  },
  {
    span: 24,
    label: '信息来源',
    component: 'AInput',
    placeholder: '请输入信息来源',
    prop: 'source',
    allowClear: true
  },
  {
    span: 24,
    label: '附件',
    component: 'AUploadMultiple',
    prop: 'annexIds'
  }
]

const formRules = {
  title: [{
      required: true,
      message: '标题不能为空',
      trigger: 'blur'
    },
    {
      min: 1,
      max: 100,
      message: '输入的字数不能超过100个',
      trigger: 'blur'
    }
  ],
  type: [{
    required: true,
    message: '文章类型不能为空',
    trigger: 'blur'
  }],
  content: [{
    required: true,
    message: '内容不能为空',
    trigger: ['blur']
  }],
  pulishDate: [{
    required: true,
    message: '发布日期不能为空',
    trigger: ['blur']
  }]
}

const formInfo = [{
    label: '标题',
    value: '-',
    key: 'title'
  },
  {
    label: '文章类型',
    value: '-',
    key: 'type'
  },

  {
    label: '发布日期',
    value: '-',
    key: 'pulishDate'
  },
  {
    label: '首图',
    value: '-',
    key: 'pic',
    isVHtml: true
  },
  {
    label: '内容',
    value: '-',
    key: 'content',
    isVHtml: true
  },
  {
    label: '信息来源',
    value: '-',
    key: 'source'
  },
  {
    label: '附件',
    value: '-',
    key: 'annexes',
    isVHtml: true
  }
]

module.exports = {
  formRows,
  formRules,
  formInfo
}